/*
 * CommonMacro.h
 *
 *  Created on: 2011-2-15
 *      Author: terry
 */

#ifndef COMMONMACRO_H_
#define COMMONMACRO_H_


#ifndef SAFE_RELEASE
#define	SAFE_RELEASE(ptr)	{ if ( (ptr) != NULL ) { ptr->Release(); ptr = NULL;} }
#endif //SAFE_RELEASE


#ifndef FAILED_RETURN
#define	FAILED_RETURN(hr)	{ if ( FAILED(hr) ) { return hr; } }
#endif //FAILED_RETURN


#ifndef		CheckPointer
#define		CheckPointer(p,ret)		{if( (p) == NULL) return (ret);}
#endif


#endif /* COMMONMACRO_H_ */
